﻿using System;
using System.Drawing;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Snake.GameBase;

namespace Snake
{
    class GameComponentFactory
    {
        public static Size DefaltSize { get; set; }
        public static Brush ColorOfSnakeHead { get; set; }
        public static Brush ColorOfSnakeBody { get; set; }
        public static Brush ColorOfWall { get; set; }
        public static Brush ColorOfFood { get; set; }
        public static Brush ColorOfGate { get; set; }
        public static Brush ColorOfTrap { get; set; }
        public static Color ColorOfBackground { get; set; }

        public static IGameComponent CreateSnakeHead(Point position)
        {
            return new SnakeComponent(position, DefaltSize, ColorOfSnakeHead);
        }
        public static IGameComponent CreateSnakeBody(Point position)
        {
            return new SnakeComponent(position, DefaltSize, ColorOfSnakeBody);
        }
        public static IGameComponent CreateWall(Point position)
        {
            return new Wall(position, DefaltSize, ColorOfWall);
        }
        public static IGameComponent CreateFood(Point position)
        {
            return new Food(position, DefaltSize, ColorOfFood);
        }
        public static IGameComponent CreateGate(Point position,Point arrival,Snake.SnakeDirection direction)
        {
            return new Gate
            {
                Position = position,
                Arrival = arrival,
                Direction = direction,
                Color=ColorOfGate,
                Size = DefaltSize
            };
        }
        public static IGameComponent CreateTrap(Point position)
        {
            return new Trap
            {
                Color = ColorOfTrap,
                Position = position,
                Size = DefaltSize
            };

        }
    }
}
